<?php 
include 'conf/configuracion_idioma.php';
include 'conf/common_index.php';
include 'template_include_index.php';
?>

<?php $title = gettext("Publicar Anuncio Vehículo Gratis"). " | " . gettext("Anuncios Locales")?>
<?php $descripcion = gettext("Publicar Anuncio Vehículo Gratis"). " | " . gettext("Anuncios Locales")?>
<?php $keywords = gettext("Publicar Anuncio Vehículo Gratis"). " | " . gettext("Anuncios Locales")?>

<?php include 'template_header_index.php'?>
<?php include 'template_nav_bar_index.php';?>
<?php include 'template_editor_texto_publicar.php'?>

<?php 
$errors = array();

if(isset($_POST['categoria'])){

	$categoria = $_POST['categoria'];
	
	if ($categoria == -1){
	  $errors['categoria'] = gettext("Debe seleccionar un tipo de vehículo");
	} else {	
	$url = get_publicar_vehiculo_post_categoria_index() . "?cid=".$categoria;
	exit('<meta http-equiv="refresh" content="0; url=' . urldecode($url) . '"/>');
	}
}

?>

<div class="container">
    <div class="row">       
        <div class="col-md-9">          	
           <h2 class="section-title"><?php echo gettext("Publicar Anuncio de Vehículo")?></h2>
           
            <div class="panel panel-primary">
                    <div class="panel-heading"><?php echo gettext("Clasificado de Vehículo")?> - <?php echo gettext("Seleccione el tipo de vehículo a publicar")?></div>
                    <div class="panel-body">
                        <form role="form" method="post">
                         
                          <div class="form-group">
                            <label for="categoria"><?php echo gettext("Seleccione el tipo de vehículo a publicar")?> <sup>*</sup></label>
                           <select id='categoria' name='categoria' class="form-control">
                            <?php
			                    $result = mysql_query("SELECT * FROM cat_vehiculos");
			                    echo "<option value='-1'>".gettext("Seleccione el tipo de vehículo a publicar")." ...</option>";
			                       while ($categoria = mysql_fetch_array($result)){?>
			                              <option value="<?php echo $categoria['categoria_id']?>" <?php if(isset($_POST['categoria']) && $_POST['categoria'] == $categoria['categoria_id']) echo "selected";?>><?php echo $categoria['nombre']?></option>
			                    <?php   }?>      
			                
			                </select>
			                <?php if (array_key_exists("categoria",$errors)){                            
                        	    echo "<div class='alert alert-danger'>$errors[categoria]</div>";                            
                          	  }?>	
                          </div>
                        
                        
                          <button type="submit" class="btn btn-ar btn-primary"><?php echo gettext("Siguiente")?></button>
                        </form>
                    </div>
             </div> <!-- panel panel-primary -->
         
        </div>
    
        <div class="col-md-3">
         
         
        </div>

    </div>
</div> <!-- container -->

<?php include 'template_footer_index.php'?>
<?php include 'template_sidebar_index.php';?>

<!-- Scripts -->
<!-- Compiled in vendors.js -->
<!--
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/jquery.cookie.js"></script>
<script src="assets/js/imagesloaded.pkgd.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/bootstrap-switch.min.js"></script>
<script src="assets/js/wow.min.js"></script>
<script src="assets/js/slidebars.min.js"></script>
<script src="assets/js/jquery.bxslider.min.js"></script>
<script src="assets/js/holder.js"></script>
<script src="assets/js/buttons.js"></script>
<script src="assets/js/jquery.mixitup.min.js"></script>
<script src="assets/js/circles.min.js"></script>
<script src="assets/js/masonry.pkgd.min.js"></script>
<script src="assets/js/jquery.matchHeight-min.js"></script>
-->

<script src="http://<?php echo DOMINIO_BASE_COMPLETO?>/js/vendors.js"></script>
<script src="http://<?php echo DOMINIO_BASE_COMPLETO?>/js/funcionesjs.js"></script>

<!-- Syntaxhighlighter -->
<script src="http://<?php echo DOMINIO_BASE_COMPLETO?>/js/syntaxhighlighter/shCore.js"></script>
<script src="http://<?php echo DOMINIO_BASE_COMPLETO?>/js/syntaxhighlighter/shBrushXml.js"></script>
<script src="http://<?php echo DOMINIO_BASE_COMPLETO?>/js/syntaxhighlighter/shBrushJScript.js"></script>

<script src="http://<?php echo DOMINIO_BASE_COMPLETO?>/js/app.js"></script>
<script src="http://<?php echo DOMINIO_BASE_COMPLETO?>/js/index.js"></script>

</body>

</html>